package com.hikvision.cms.exception;

import com.hikvision.cms.Result;
import com.hikvision.cms.ResultUtil;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


@ControllerAdvice
@ResponseBody
public class ExceptionHandlerAdvice {
    @ExceptionHandler({IllegalArgumentException.class})
    public Result handlerIllegalArgumentException(IllegalArgumentException e) {
        e.printStackTrace();
        return ResultUtil.error(Integer.valueOf(10001), "参数不合法:" + e.getMessage());
    }
}
